<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta http-equiv="X-UA-Compatible" content="IE=edge" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>Document</title>
  </head>
  <style>
    pre {
      color: red;
      padding: 10px 15px;
      background: #f0f0f0;
      font: 12px/1.5 Courier New;
    }
    span {
      color: #999;
    }
  </style>
  <body>
    <pre>
        &lt;script type="text/javascript"&gt;
            alert(typeof 12345);	<span>//输出number</span>
            alert(typeof "abc");	<span>//输出string</span>
            alert(typeof document);	<span>//输出object</span>
        &lt;/script&gt;
    </pre>
  </body>
  <script>
    alert(
      "typeof 12345 → " +
        typeof 12345 +
        '\
	  \n\ntypeof "abc" → ' +
        typeof "abc" +
        "\
	  \n\ntypeof document → " +
        typeof document
    );
  </script>
</html>
